﻿@model Cafeteria.Models.Administracion.Usuario.UsuarioxSucursalBean
@{
    ViewBag.Title = "horario";
}
<h2>Horario del Personal</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm("modificarHorario", "Usuario", FormMethod.Post, new { @class = "form" }))
{
    <fieldset>
        <div class = "widget" >  @Html.HiddenFor(model => model.ID)
            <div class = "title" >
                <img src="@Url.Content("~/Content/images/icons/dark/list.png")"  class="titleIcon">
                <h6>@ViewBag.Title</h6>
            </div>
            <div class = "formRow" >  @Html.LabelFor(model => model.nombres)
                <div class = "formRight" > @Html.DisplayFor(model => model.nombres)   </div>@Html.HiddenFor(model => model.nombres) 
                <div class = "clear" ></div>
            </div>

            <div class = "formRow" > @Html.LabelFor(model => model.nroDocumento)
                <div class = "formRight" > @Html.DisplayFor(model => model.nroDocumento) </div> @Html.HiddenFor(model => model.nroDocumento)
                <div class = "clear" ></div>
            </div>

            <div class="formRow">
               <span>Sucursal</span>                             
                <div class = "formRight" > @Html.DisplayFor(model => model.sucursal) </div> @Html.HiddenFor(model => model.sucursal)
                <div class = "clear" ></div>
            </div>

            <div class = "formRow" > @Html.LabelFor(model => model.fechaIngreso) 
                 <div class = "formRight" >  @Html.DisplayFor(model => model.fechaIngreso)   </div> @Html.HiddenFor(model => model.fechaIngreso) 
                <div class = "clear" ></div>
            </div>

            <div class = "formRow" > Fecha Fin
                <div class = "formRight" >
                       @Html.DisplayFor(model => model.fechaFin)   @Html.HiddenFor(model => model.fechaFin)
                </div>
                <div class = "clear" ></div>
            </div>
        

        </div>
        
        </fieldset>
    
    if (Model.dia.Count <= 0)
    {
        <p>
        <a href="@Url.Action("Horario", new { id = Model.ID })"><img src="../../Content/images/icons/color/plus.png", alt="Create" />Añadir horario</a>
        </p>
    }
    else
    {
    
        <div class="widget">
          <div class="title"><img src="../../Content/images/icons/dark/frames.png" alt="" class="titleIcon" /><h6>Asignar horario</h6></div>
            <table cellpadding="0" cellspacing="0" width="100%" class="sTable">
                <thead>
                    <tr>
                        <td>Dia</td>
                        <td>Hora de Ingreso</td>
                        <td>Hora de Salida</td>
                    </tr>
                </thead>
            <tbody>
         
                @for (int i = 0; i < Model.dia.Count; i++)
                {
                    if (!string.IsNullOrEmpty(Model.dia[i]))
                    {
                        <tr >
                            <td>@Html.DisplayFor(model => Model.dia[i])</td>@Html.HiddenFor(model => Model.dia[i])
                            <td>@Html.DisplayFor(model => Model.horaInicio[i])</td>@Html.HiddenFor(model => Model.horaInicio[i])
                            <td>@Html.DisplayFor(model => Model.horaFin[i])</td>@Html.HiddenFor(model => Model.horaFin[i])
                
                       </tr>
                    }
                    else
                    {
                        @Html.HiddenFor(model => Model.dia[i])
                           @Html.HiddenFor(model => Model.horaInicio[i])
                           @Html.HiddenFor(model => Model.horaFin[i])
                    }


                }
               
            </tbody>
        </table>
      </div>
    }

    
    
    
    <p>
        <a href="javascript:history.back()">Regresar</a>
    </p>
}

